home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form1
- Caption = "Form1"
- ClientHeight = 2805
- ClientLeft = 405
- ClientTop = 885
- ClientWidth = 4035
- Height = 3210
- Left = 345
- LinkTopic = "Form1"
- ScaleHeight = 2805
- ScaleWidth = 4035
- Top = 540
- Width = 4155
- Begin Frame Frame1
- Caption = "Frame1"
- Height = 1935
- Left = 60
- TabIndex = 0
- Top = 120
- Width = 2415
- Begin CommandButton BtnOne
- Caption = "Click Me!"
- Height = 375
- Left = 360
- TabIndex = 1
- Top = 1500
- Width = 1635
- End
- Begin Shape Shape1
- BackColor = &H0000FFFF&
- BackStyle = 1 'Opaque
- Height = 975
- Left = 360
- Shape = 1 'Square
- Top = 420
- Width = 975
- End
- End
- Option Explicit
- Sub BtnOne_Click ()
- Dim x As Integer
- ' Where is the frame when button pressed?
- If FrameLoc = InForm2 Then
- ' Move it to Form1
- x = SetParent(Ctrl_hWnd, Form1.hWnd)
- FrameLoc = InForm1
- ' Adjust its position, just for effect.
- Frame1.Top = 50: Frame1.Left = 100
- ' Show how to act on diff. form from this one Sub
- Form2.Label1 = "Frame's in Form1"
- ' Move it to Form2
- x = SetParent(Ctrl_hWnd, Form2.hWnd)
- FrameLoc = InForm2
- ' Restore its original position
- Frame1.Top = 750: Frame1.Left = 1500
- ' Modify a control that _stays_ on Form2 -- just for show.
- Form2.Label1 = "Frame's down here now!"
- End If
- End Sub
- Sub Form_Load ()
- Form2.Show
- Ctrl_hWnd = Frame1.hWnd
- FrameLoc = InForm1
- End Sub
-